﻿using Coding4FunCamera;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Drawing;
using System.Configuration;
using System.Collections.Specialized;
using System.IO;
using System;

namespace CameraTests
{
    
    
    /// <summary>
    ///This is a test class for ICameraFilterTest and is intended
    ///to contain all ICameraFilterTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ICameraFilterTest
    {

        private TestContext testContextInstance;
        private static NameValueCollection _configurationValues;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        public static void MyClassInitialize(TestContext testContext)
        {
            _configurationValues = ConfigurationManager.AppSettings;
        }
       
        #endregion


        internal virtual ICameraFilter CreateICameraFilter()
        {
            string fileName = _configurationValues["inputimagefile"];
            ICameraFilter target = new ColorFilter(fileName);
            return target;
        }

        /// <summary>
        ///A test for Apply
        ///</summary>
        [TestMethod()]
        public void ApplyTest()
        {
            ICameraFilter target = CreateICameraFilter(); 
            Object expected = null;

            expected = target.Apply();
            Assert.IsNotNull(expected);
            Assert.IsInstanceOfType(expected, Type.GetType("Bitmap"));
            
        }
    }
}
